package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhElectricOrderMapper;
import com.ruoyi.zsyh.domain.ZsyhElectricOrder;
import com.ruoyi.zsyh.service.IZsyhElectricOrderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 整机服务订单Service业务层处理
 * 
 * @author yuexl
 * @date 2022-03-11
 */
@Service
public class ZsyhElectricOrderServiceImpl implements IZsyhElectricOrderService 
{
    @Autowired
    private ZsyhElectricOrderMapper zsyhElectricOrderMapper;

    /**
     * 查询整机服务订单
     * 
     * @param id 整机服务订单ID
     * @return 整机服务订单
     */
    @Override
    public ZsyhElectricOrder selectZsyhElectricOrderById(String id)
    {
        return zsyhElectricOrderMapper.selectZsyhElectricOrderById(id);
    }

    /**
     * 查询整机服务订单列表
     * 
     * @param zsyhElectricOrder 整机服务订单
     * @return 整机服务订单
     */
    @Override
    public List<ZsyhElectricOrder> selectZsyhElectricOrderList(ZsyhElectricOrder zsyhElectricOrder)
    {
        return zsyhElectricOrderMapper.selectZsyhElectricOrderList(zsyhElectricOrder);
    }

    /**
     * 新增整机服务订单
     * 
     * @param zsyhElectricOrder 整机服务订单
     * @return 结果
     */
    @Override
    public int insertZsyhElectricOrder(ZsyhElectricOrder zsyhElectricOrder)
    {
        zsyhElectricOrder.setCreateTime(DateUtils.getNowDate());
        return zsyhElectricOrderMapper.insertZsyhElectricOrder(zsyhElectricOrder);
    }

    /**
     * 修改整机服务订单
     * 
     * @param zsyhElectricOrder 整机服务订单
     * @return 结果
     */
    @Override
    public int updateZsyhElectricOrder(ZsyhElectricOrder zsyhElectricOrder)
    {
        zsyhElectricOrder.setUpdateTime(DateUtils.getNowDate());
        return zsyhElectricOrderMapper.updateZsyhElectricOrder(zsyhElectricOrder);
    }

    /**
     * 删除整机服务订单对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhElectricOrderByIds(String ids)
    {
        return zsyhElectricOrderMapper.deleteZsyhElectricOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除整机服务订单信息
     * 
     * @param id 整机服务订单ID
     * @return 结果
     */
    @Override
    public int deleteZsyhElectricOrderById(String id)
    {
        return zsyhElectricOrderMapper.deleteZsyhElectricOrderById(id);
    }
}
